Skip to content

Add notification templates in code repository in HTML format#509

Draft
nikomakela wants to merge 5 commits into
KK-1441-notification-template-csv-exportfrom
KK-1441-email-templates
Draft

Add notification templates in code repository in HTML format#509
nikomakela wants to merge 5 commits into
KK-1441-notification-template-csv-exportfrom
KK-1441-email-templates

Conversation

@nikomakela

@nikomakela nikomakela commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

KK-1441.

Based on #506, which starts using the notification_importer app (that was copied from Kultus), but with a Google Spreadsheet importer.

In this PR, the notification templates content is copied from https://docs.google.com/spreadsheets/d/1TkdQsO50DHOg5pi1JhzudOL1GKpiK-V2DCIoAipKj-M. The content is then added to notification template HTML files that can be imported with notification_importers.notification_importer.NotificationFileImporter.

This changes the Google Spreadsheet importer to a file importer, so the notification templates can be fetched from the project's repository. The templates needs to be under notification_importers app in templates -folder. They should be categorized by the notification type, so the emai ltemplates should be under notification_importers/templates/email/ -folder. Then the files should be named so that the name is constracted from [type]-[locale].html.

The notification importer needs <title> -tag in order to set subject field properly. Also the HTML syntax makes the template look better when sent to customer. However, since there is no design for those templates yet, the HTML content should be as simple as possible (e.g. similar to markdown format). Target was to convert plain text messages to minimal HTML equivalent.

Instead of showing the long and ugly URL, now when we are using HTML-formatted notification templates, we could also use some text as a link instead of the URL (as text).

image

@nikomakela nikomakela requested a review from karisal-anders June 5, 2025 12:55
@nikomakela nikomakela marked this pull request as ready for review June 5, 2025 12:55
@nikomakela nikomakela requested a review from a team as a code owner June 5, 2025 12:55
@nikomakela

nikomakela commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

NOTE: Since the text and format in notifications have changed, the content needs to be approved by the product owner. The templates can be previewed from the django admin site.

  • Ask approval from the product owner.

@nikomakela nikomakela force-pushed the KK-1441-notification-template-csv-export branch 2 times, most recently from 889a52c to 77ba0ef Compare June 5, 2025 13:34
KK-1441.

Change the Google Spreadsheet importer to a file importer, so the
notification templates can be fetched from the project's repository. The
templates needs to be under `notification_importers` app in templates
-folder. They should be categorized by the notification type, so the
emai ltemplates should be under notification_importers/templates/email/
-folder. Then the files should be named so that the name is constracted
from `[type]-[locale].html`
KK-1441.

Copy the notification templates contents from the Google Spreadsheet
(https://docs.google.com/spreadsheets/d/
1TkdQsO50DHOg5pi1JhzudOL1GKpiK-V2DCIoAipKj-M), so they can be imported
to database by using the
`notification_importers.notification_importer.NotificationFileImporter`
instead of the spreadsheet importer.
KK-1441.

The is_obsolete -field is removed from the user model, so it cannot be
used anymore in the notification templates either, because rendering the
template would fail.

Remove the is_obsolete if-statements from the notification templates
where it was used.
KK-1441.

The notification importer needs `<title>` -tag in order to set subject
field properly. Also the HTML syntax makes the template look better when
sent to customer. However, since there is no design for those templates
yet, the HTML content should be as simple as possible (e.g. similar to
markdown format). Target was to convert plain text messages to minimal
HTML equivalent.
KK-1441.

Instead of showing the long and ugly URL, now when we are using
HTML-formatted notification templates, we could also use some text as a
link instead of the URL (as text).
@nikomakela nikomakela force-pushed the KK-1441-email-templates branch from 8c6fab7 to 79cc045 Compare June 5, 2025 13:35
@nikomakela nikomakela added the Comodori Team Comodori's projected work. label Jun 6, 2025
@nikomakela nikomakela self-assigned this Jun 6, 2025
@karisal-anders karisal-anders removed their request for review September 18, 2025 12:31
@karisal-anders

Copy link
Copy Markdown
Contributor

Removed review request from myself to make my review request list more up to date. If this really needs code review still, and this is really going to be merged, then please ask for code review from me anew. Thank you!

@nikomakela nikomakela marked this pull request as draft April 8, 2026 12:10
@nikomakela

Copy link
Copy Markdown
Contributor Author

Converted to draft, since there is no plan for this yet and Solution office requested the change to draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Comodori Team Comodori's projected work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants